#ifndef _PARAMETER_H
#define	_PARAMETER_H
#include <main_config.h>
#include <config.h>

#define panic()		while(1)


#define PARAMETER_PLL_MAGIC			0x54460010
#define PARAMETER_PCIE_MAGIC		0x54460011
#define PARAMETER_COMMON_MAGIC		0x54460013
#define PARAMETER_MCU_MAGIC			0x54460014

/* customer */
#define	PARAMETER_PAD_SEL_MAGIC		0x64460010
#define PARAMETER_HEADER_MAGIC		0x64460011
#define PARAMETER_INTERFACE_MAGIC	0x64460012

#define	PARAMETER_COUNT	(7)

#define C_PARAMETER_BASE		(0x00)

#define PM_HEAD_OFFSET				(0x000)
#define PM_PLL_OFFSET				(0x100)
#define PM_PCIE_OFFSET				(0x200)
#define PM_MCU_OFFSET				(0x300)
#define PM_COMMON_OFFSET			(0x400)
#define PM_PAD_SEL_OFFSET			(0x600)
#define PM_DEV_INTERFACE_OFFSET		(0x700)

typedef struct pm_info{
	char *initrd_size;
	char *initrd_size_bd;
	char *initrd_start;
	char pack_time[32];
}pm_info_t;

typedef enum
{
	PM_DEBUG = 0x0,
	PM_TEST,
	PM_RELEASE,
}pm_mode;

typedef struct parameter_base{
	    uint64_t addr;
	    pm_mode mode;
}parameter_base_t;

//生成参数表
typedef int (*cfg_bin_fnc_t)(FILE * const fp, pm_info_t const *pm_d);
//校验参数表
typedef int (*check_fnc_t )(FILE * const fp, uint64_t base);
//显示参数表
typedef int (*prf_bin_fnc_t )(FILE * const fp, parameter_base_t const *p_base);

typedef struct pm_list_fun{
	cfg_bin_fnc_t cfg_fnc;
	check_fnc_t ck_fnc;
	prf_bin_fnc_t prf_fnc;
}pm_list_fun_t;

extern pm_list_fun_t head_fun;
extern pm_list_fun_t pll_fun;
extern pm_list_fun_t peu_fun;
extern pm_list_fun_t mcu_fun;
extern pm_list_fun_t common_fun;
extern pm_list_fun_t dev_fun;

#endif
